﻿using System;
namespace RapidRepository
{
    internal interface IFileManager
    {
        /// <summary>
        /// Deletes the specified type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="id">The id.</param>
        void Delete(Type type, Guid id);

        /// <summary>
        /// Returns true if the entity exists on the file system.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        bool Exists<T>(Guid id);

        /// <summary>
        /// Gets the file by file name.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="fileName">Name of the file.</param>
        /// <returns></returns>
        string GetFile<T>(Guid fileName);

        /// <summary>
        /// Loads the files.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        string[] LoadFiles<T>();

        /// <summary>
        /// Saves the specified type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="id">The id.</param>
        /// <param name="serialisedObject">The serialised object.</param>
        void Save(Type type, Guid id, string serialisedObject);

        /// <summary>
        /// Saves the view file.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="serialisedObject">The serialised object.</param>
        void SaveViewFile(Type type, string serialisedObject);

        /// <summary>
        /// Gets the view file.
        /// </summary>
        /// <param name="viewType">Type of the view.</param>
        string GetViewFile(Type viewType);
    }
}
